import Vue from 'vue'
import Router from 'vue-router'



const index = () => import('@/components/index')
const home = () => import('@/components/home')
const mine = () => import('@/components/mine')
const userInfo = () => import('@/components/userInfo')
const order = () => import('@/components/order')
const courseDetail = () => import('@/components/courseDetail')
const videoPlayer = () => import('@/components/videoPlayer')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: home
        },
        {
          path: '/mine/:openId',
          name: 'mine',
          component: mine
        },
        {
          path: '/userInfo/:openId',
          name: 'userInfo',
          component: userInfo
        },
        {
          path: '/order',
          name: 'order',
          component: order
        },
        {
          path: '/courseDetail',
          name: 'courseDetail',
          component: courseDetail
        },
        {
          path: '/videoPlayer',
          name: 'videoPlayer',
          component: videoPlayer
        },
       
        // {
        //   path: '/taskDetail/:openId',
        //   name: 'taskDetail',
        //   component: taskDetail,
        //   meta: {
        //     level: 2,
        //   }
        // },
        
      ]
    },
    
    
    
  ]
})
